window.khanhhoi = (function() {
    'use strict';
    var _pageRender = function(pluginIN, callback, strView) {
        $.ajax({
            url: "render.html",
            type: "get",
            data: {plugin: pluginIN, strView: strView},
            dataType: "json"
        }).done(function(rtData) {
            $("#main-content").html(unescape(rtData.HTML));
            $.globalEval(rtData.SCRIPT);
            //update menu
            if (callback) {
                callback(rtData);
            }
        });
    };
    var _menuRender = function() {
        $(document).ready(function(e) {
            $.ajax({
                url: "menu.html",
                type: "get",
                dataType: "json",
            }).done(function(rtData) {
                $(".sf-menu").html(unescape(rtData.Menu));
            });
        });
    };
    return {
        pageRender: _pageRender,
        menuRender: _menuRender
    };
})(jQuery);